package com.myselflearn.testng.testng;

import org.apache.commons.lang3.StringUtils;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class MultiThread {
	@BeforeClass
	public void setUp() {
		// code that will be invoked when this test is instantiated
	}

	@Test(groups = "HelloTest")
	public void helloTest() {
		System.out.println(Thread.currentThread().getId()
				+ StringUtils.leftPad("Hello Word", 40, "*"));
		// throw new Error("Hello Test Error");
	}

	@Test(threadPoolSize = 10, invocationCount = 5, timeOut = 1000, groups = "multie")
	public void multiThreadTest() {
		System.out.println(Thread.currentThread().getId()
				+ StringUtils.leftPad("MultiThreadTest", 40, "*"));
		// throw new Error("Hello MultiThreadTest Error");
	}

	@Test(groups = { "HelloNature" })
	public void helloNatureTest() {
		System.out.println(Thread.currentThread().getId()
				+ StringUtils.leftPad("HelloNature", 40, "*"));
		// throw new Error("Hello Nature Error");
	}
}
